using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._GeoAnalyticsDesktopTools._FindLocations
{
    /// <summary>
    /// <para>Detect Incidents</para>
    /// <para>Creates a layer that detects features that meet a given condition.</para>
    /// <para>创建一个图层，用于检测满足给定条件的要素。</para>
    /// </summary>    
    [DisplayName("Detect Incidents")]
    public class DetectIncidents : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public DetectIncidents()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_input_layer">
        /// <para>Input Layer</para>
        /// <para>The input features that contain potential incidents.</para>
        /// <para>包含潜在事件的输入要素。</para>
        /// </param>
        /// <param name="_output">
        /// <para>Output Dataset</para>
        /// <para>A new output dataset that contains incidents.</para>
        /// <para>包含事件的新输出数据集。</para>
        /// </param>
        /// <param name="_track_fields">
        /// <para>Track Fields</para>
        /// <para>A field or fields that will be used to identify unique tracks.</para>
        /// <para>将用于标识唯一轨迹的一个或多个字段。</para>
        /// </param>
        /// <param name="_start_condition">
        /// <para>Start Condition</para>
        /// <para><xdoc>
        ///   <para>The condition that will be used to identify incidents. Expressions are written in Arcade and can include [+ - * / ] operators and multiple fields.</para>
        ///   <para>If the layer is added to the map, the Fields and Helpers filters can be used to build an expression.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将用于识别事件的条件。表达式是在 Arcade 中编写的，可以包括 [+ - * / ] 运算符和多个字段。</para>
        ///   <para>如果将图层添加到地图中，则可以使用字段和帮助程序过滤器来构建表达式。</para>
        /// </xdoc></para>
        /// </param>
        public DetectIncidents(object _input_layer, object _output, List<object> _track_fields, object _start_condition)
        {
            this._input_layer = _input_layer;
            this._output = _output;
            this._track_fields = _track_fields;
            this._start_condition = _start_condition;
        }
        public override string ToolboxName => "GeoAnalytics Desktop Tools";

        public override string ToolName => "Detect Incidents";

        public override string CallName => "gapro.DetectIncidents";

        public override List<string> AcceptEnvironments => ["extent", "outputCoordinateSystem", "parallelProcessingFactor", "workspace"];

        public override object[] ParameterInfo => [_input_layer, _output, _track_fields, _start_condition, _end_condition, _output_mode.GetGPValue(), _time_boundary_split, _time_boundary_reference];

        /// <summary>
        /// <para>Input Layer</para>
        /// <para>The input features that contain potential incidents.</para>
        /// <para>包含潜在事件的输入要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Layer")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _input_layer { get; set; }


        /// <summary>
        /// <para>Output Dataset</para>
        /// <para>A new output dataset that contains incidents.</para>
        /// <para>包含事件的新输出数据集。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Dataset")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _output { get; set; }


        /// <summary>
        /// <para>Track Fields</para>
        /// <para>A field or fields that will be used to identify unique tracks.</para>
        /// <para>将用于标识唯一轨迹的一个或多个字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Track Fields")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public List<object> _track_fields { get; set; }


        /// <summary>
        /// <para>Start Condition</para>
        /// <para><xdoc>
        ///   <para>The condition that will be used to identify incidents. Expressions are written in Arcade and can include [+ - * / ] operators and multiple fields.</para>
        ///   <para>If the layer is added to the map, the Fields and Helpers filters can be used to build an expression.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将用于识别事件的条件。表达式是在 Arcade 中编写的，可以包括 [+ - * / ] 运算符和多个字段。</para>
        ///   <para>如果将图层添加到地图中，则可以使用字段和帮助程序过滤器来构建表达式。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Start Condition")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _start_condition { get; set; }


        /// <summary>
        /// <para>End Condition</para>
        /// <para><xdoc>
        ///   <para>The condition that will be used to end incidents. If no end condition is specified, incidents will end when the start condition is no longer true.</para>
        ///   <para>Expressions are written in Arcade and can include operators and multiple fields.</para>
        ///   <para>If the layer is added to the map, the Fields and Helpers filters can be used to build an expression.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>将用于结束事件的条件。如果未指定结束条件，则当开始条件不再为 true 时，事件将结束。</para>
        ///   <para>表达式是在 Arcade 中编写的，可以包含运算符和多个字段。</para>
        ///   <para>如果将图层添加到地图中，则可以使用字段和帮助程序过滤器来构建表达式。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("End Condition")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _end_condition { get; set; } = null;


        /// <summary>
        /// <para>Output Mode</para>
        /// <para><xdoc>
        ///   <para>Specifies the features that will be returned.</para>
        ///   <bulletList>
        ///     <bullet_item>All features—All the input features will be returned. This is the default.</bullet_item><para/>
        ///     <bullet_item>Incidents—Only features that were found to be incidents will be returned.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定将返回的功能。</para>
        ///   <bulletList>
        ///     <bullet_item>所有要素—将返回所有输入要素。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>事件 - 仅返回被认定为事件的要素。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Mode")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _output_mode_value _output_mode { get; set; } = _output_mode_value._ALL_FEATURES;

        public enum _output_mode_value
        {
            /// <summary>
            /// <para>All features</para>
            /// <para>All features—All the input features will be returned. This is the default.</para>
            /// <para>所有要素—将返回所有输入要素。这是默认设置。</para>
            /// </summary>
            [Description("All features")]
            [GPEnumValue("ALL_FEATURES")]
            _ALL_FEATURES,

            /// <summary>
            /// <para>Incidents</para>
            /// <para>Incidents—Only features that were found to be incidents will be returned.</para>
            /// <para>事件 - 仅返回被认定为事件的要素。</para>
            /// </summary>
            [Description("Incidents")]
            [GPEnumValue("INCIDENTS")]
            _INCIDENTS,

        }

        /// <summary>
        /// <para>Time Boundary Split</para>
        /// <para>A time span to split the input data into for analysis. A time boundary allows you to analyze values within a defined time span. For example, if you use a time boundary of 1 day, and set the time boundary reference to January 1, 1980, tracks will be split at the beginning of every day.</para>
        /// <para>将输入数据拆分为以进行分析的时间跨度。时间边界允许您在定义的时间跨度内分析值。例如，如果使用 1 天的时间边界，并将时间边界参考设置为 1980 年 1 月 1 日，则将在每天开始时拆分轨道。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Time Boundary Split")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _time_boundary_split { get; set; } = null;


        /// <summary>
        /// <para>Time Boundary Reference</para>
        /// <para>The reference time used to split the input data into for analysis. Time boundaries will be created for the entire span of the data, and the reference time does not need to occur at the start. If no reference time is specified, January 1, 1970, is used.</para>
        /// <para>用于将输入数据拆分为用于分析的参考时间。将为数据的整个跨度创建时间边界，并且参考时间不需要在开始时出现。如果未指定参考时间，则使用 1970 年 1 月 1 日。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Time Boundary Reference")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _time_boundary_reference { get; set; } = null;


        public DetectIncidents SetEnv(object extent = null, object outputCoordinateSystem = null, object parallelProcessingFactor = null, object workspace = null)
        {
            base.SetEnv(extent: extent, outputCoordinateSystem: outputCoordinateSystem, parallelProcessingFactor: parallelProcessingFactor, workspace: workspace);
            return this;
        }

    }

}